package com.eco.fanliapp.utils;

public class StringUtils {

    public static boolean isNotNull(String str) {

        return !isNull(str);
    }

    public static boolean isNull(String str) {
        if (str == null || "".equals(str) || "".equals(str.trim())) {
            return true;
        }
        return false;
    }

    public static boolean isNotBlank(String str) {
        return isNotNull(str);
    }

    public static boolean isBlank(String str) {
        return isNull(str);
    }


    public static boolean stringEquals(String a, String b) {
        if (a == b) return true;
        if ("".equals(a) || "".equals(a.trim())) {
            if (b == null) {
                return true;
            }
        }
        if ("".equals(b) || "".equals(b.trim())) {
            if (a == null) {
                return true;
            }
        }
        int length;
        if (a != null && b != null && (length = a.length()) == b.length()) {
            if (a instanceof String && b instanceof String) {
                return a.equals(b);
            } else {
                for (int i = 0; i < length; i++) {
                    if (a.charAt(i) != b.charAt(i)) return false;
                }
                return true;
            }
        }
        return false;
    }
}
